<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-2-2
 * Time: 下午3:00
 */

namespace api\behaviors;


use yii\base\ActionFilter;
use yii\base\ErrorException;

class IcbcIpFilter extends ActionFilter
{
    public function beforeAction($action)
    {
        /*if (YII_ENV != 'dev'){
            $allow_ips = ['12.1.1.', '192.168', '109.2.5'];
            if (!in_array(substr(\Yii::$app->request->userIP, 0, 7), $allow_ips)){
                throw new ErrorException('不是工行专线!IP:'.\Yii::$app->request->userIP);
            }
        }*/
        return parent::beforeAction($action); // TODO: Change the autogenerated stub
    }
}